# Contributor: Maxim Karasev <mxkrsv@disroot.org>
# Maintainer: Patrycja Rosa <alpine@ptrcnull.me>
pkgname=oxipng
pkgver=9.1.1
pkgrel=0
pkgdesc="Multithreaded PNG optimizer written in Rust"
url="https://github.com/shssoichiro/oxipng"
# armhf: does not build here, and useless
arch="all !armhf"
license="MIT"
makedepends="cargo cargo-auditable"
source="https://github.com/shssoichiro/oxipng/archive/v$pkgver/oxipng-$pkgver.tar.gz"
options="net" # required for cargo fetch

prepare() {
	default_prepare

	# forces qemu-aarch64 on aarch64 (why??)
	rm .cargo/config.toml

	cargo fetch --locked
}

build() {
	cargo auditable build --release --frozen
}

check() {
	cargo test --frozen
}

package() {
	install -Dm755 target/release/oxipng -t "$pkgdir"/usr/bin/
}

sha512sums="
3d941f991b5ae82364e088a845919b5d88a335e56853044a835007d903844e4800f166c8d649413c97252ec7f70a28f93f633ecec81e6df2194cd87bc0c13297  oxipng-9.1.1.tar.gz
"
